{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CVE-2024-46726\n",
      "CVE-2024-46759\n",
      "CVE-2024-46762\n",
      "CVE-2024-46743\n",
      "CVE-2024-46758\n",
      "CVE-2024-46763\n",
      "CVE-2024-46760\n",
      "CVE-2024-46719\n",
      "CVE-2024-46776\n",
      "CVE-2024-46744\n",
      "CVE-2024-46770\n",
      "CVE-2024-46771\n",
      "CVE-2024-46746\n",
      "CVE-2024-46787\n",
      "CVE-2024-46742\n",
      "CVE-2024-46727\n",
      "CVE-2024-46775\n",
      "CVE-2024-46725\n",
      "CVE-2024-46747\n",
      "CVE-2024-46750\n",
      "CVE-2024-46722\n",
      "CVE-2024-46730\n",
      "CVE-2024-46772\n",
      "CVE-2024-46777\n",
      "CVE-2024-46781\n",
      "CVE-2024-46740\n",
      "CVE-2024-46729\n",
      "CVE-2024-46721\n",
      "CVE-2024-46782\n",
      "CVE-2024-46724\n",
      "CVE-2024-46773\n",
      "CVE-2024-46723\n",
      "CVE-2024-46780\n",
      "CVE-2024-46778\n",
      "CVE-2024-46791\n",
      "CVE-2024-46745\n",
      "CVE-2024-46732\n",
      "CVE-2024-46733\n",
      "CVE-2024-46783\n",
      "CVE-2024-46756\n",
      "CVE-2024-46728\n",
      "CVE-2024-46737\n",
      "CVE-2024-46761\n",
      "CVE-2024-46757\n",
      "CVE-2024-46755\n",
      "CVE-2024-46739\n",
      "CVE-2024-46714\n",
      "CVE-2024-46731\n",
      "CVE-2024-46738\n",
      "CVE-2024-46765\n",
      "CVE-2024-46707\n",
      "CVE-2024-46702\n",
      "CVE-2024-46695\n",
      "CVE-2024-46811\n"
     ]
    }
   ],
   "source": [
    "# 1. 获取CI网站中到期日期为xxxx-xxxx的cve_id列表\n",
    "# 阶段为 漏洞修复的待修复阶段\n",
    "# 由于每次获取都需要 即时 的信息，所已无需进行存储\n",
    "import service.CIService as CIService\n",
    "\n",
    "startExpDate = '2024-10-13'\n",
    "endExpDate = '2024-10-22'\n",
    "CIInfoList = CIService.getCIInfoList(startExpDate, endExpDate)\n",
    "CIInfoList.sort(key=lambda x: x.expirationTime)\n",
    "for CIInfo in CIInfoList:\n",
    "    print(CIInfo.cve_id)\n",
    "\n",
    "## 额外操作, 为后面的分析做准备\n",
    "cve_id_list = []\n",
    "for CIInfo in CIInfoList:\n",
    "    cve_id_list.append(CIInfo.cve_id)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1.2 从表格中复制cve_id_list\n",
    "# cve_id_list = \"\"\"\"\"\".split(\"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "#IAX89Y 【漏洞】 【OpenHarmony-4.0-Release】 CVE-2024-42131 CVE-2024-42131\n",
      "#IAX89V 【漏洞】 【OpenHarmony-4.1-Release】 CVE-2024-42131 CVE-2024-42131\n",
      "#IAX89L 【漏洞】 【master】 CVE-2024-42131 CVE-2024-42131\n",
      "#IAX809 【漏洞】 【OpenHarmony-4.1-Release】 CVE-2024-41049 CVE-2024-41049\n",
      "#IAX807 【漏洞】 【OpenHarmony-4.0-Release】 CVE-2024-41049 CVE-2024-41049\n",
      "#IAX805 【漏洞】 【master】 CVE-2024-41049 CVE-2024-41049\n",
      "#IAX7Z0 【漏洞】 【OpenHarmony-4.1-Release】 CVE-2024-26720 CVE-2024-26720\n",
      "#IAX7YW 【漏洞】 【OpenHarmony-4.0-Release】 CVE-2024-26720 CVE-2024-26720\n",
      "#IAX7YV 【漏洞】 【master】 CVE-2024-26720 CVE-2024-26720\n",
      "#IAX7Y2 【漏洞】 【OpenHarmony-4.1-Release】 CVE-2024-27043 CVE-2024-27043\n",
      "#IAX7XZ 【漏洞】 【OpenHarmony-4.0-Release】 CVE-2024-27043 CVE-2024-27043\n",
      "#IAX7XY 【漏洞】 【master】 CVE-2024-27043 CVE-2024-27043\n",
      "#IAX7X2 【漏洞】 【OpenHarmony-4.1-Release】 CVE-2024-26684 CVE-2024-26684\n",
      "#IAX7X1 【漏洞】 【OpenHarmony-4.0-Release】 CVE-2024-26684 CVE-2024-26684\n",
      "#IAX7WZ 【漏洞】 【master】 CVE-2024-26684 CVE-2024-26684\n",
      "#IAX7V8 【漏洞】 【OpenHarmony-4.0-Release】 CVE-2024-26627 CVE-2024-26627\n",
      "#IAX7V3 【漏洞】 【OpenHarmony-4.1-Release】 CVE-2024-26627 CVE-2024-26627\n",
      "#IAX7UZ 【漏洞】 【master】 CVE-2024-26627 CVE-2024-26627\n",
      "#IAX7R2 【漏洞】 【OpenHarmony-4.1-Release】 CVE-2024-46679 CVE-2024-46679\n",
      "#IAX7QW 【漏洞】 【OpenHarmony-4.0-Release】 CVE-2024-46679 CVE-2024-46679\n",
      "#IAX7O1 【漏洞】 【master】 CVE-2024-46679 CVE-2024-46679\n",
      "#IAWW5C [安全问题]: [master]【linux kernel 5.10.210】【必现-3/3】linux kernel组件存在CVE漏洞CVE-2021-4442 CVE-2021-4442\n",
      "#IA665I 【Openharmony_4.1_release】【RK3568】【必现】【Kernel_linux_5.10】打开编译选项CONFIG_BLK_CGROUP后编译失败 None\n"
     ]
    }
   ],
   "source": [
    "# 1.3 从issue中获取cve_id_list\n",
    "import service.GiteeService as GiteeService\n",
    "issue_list = []\n",
    "\n",
    "def pullIssuesFromGitee(page_start, page_end):\n",
    "    gitee_urls = []\n",
    "    for i in range(page_start, page_end + 1):\n",
    "        gitee_urls.append('https://gitee.com/openharmony/kernel_linux_5.10/issues?page=' + str(i) + '&state=open')\n",
    "    GiteeService.fillInIssueList(gitee_urls, issue_list)\n",
    "\n",
    "start=1\n",
    "end=2\n",
    "pullIssuesFromGitee(page_start=start, page_end=end)\n",
    "# 执行时间较长\n",
    "for item in issue_list:\n",
    "    print(item.no, item.title, item.cve_id) # 可以查看Issue的定义来获取信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--------------Gitee中的信息---------------\n",
      "CVE-2024-46726 没有历史issue\n",
      "CVE-2024-46759 没有历史issue\n",
      "CVE-2024-46762 没有历史issue\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[2], line 12\u001b[0m\n\u001b[0;32m     10\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m--------------Gitee中的信息---------------\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m     11\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m cve_id \u001b[38;5;129;01min\u001b[39;00m cve_id_list:\n\u001b[1;32m---> 12\u001b[0m     \u001b[38;5;28mprint\u001b[39m(\u001b[43mAnalysisService\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43manalyzeGiteeWithoutCache\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcve_id\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[0;32m     13\u001b[0m \u001b[38;5;66;03m# 2.3 获取CI网站中的信息\u001b[39;00m\n\u001b[0;32m     14\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m--------------CI网站中的信息---------------\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\service\\AnalysisService.py:52\u001b[0m, in \u001b[0;36manalyzeGiteeWithoutCache\u001b[1;34m(cve_id)\u001b[0m\n\u001b[0;32m     50\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21manalyzeGiteeWithoutCache\u001b[39m(cve_id):\n\u001b[0;32m     51\u001b[0m         info \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m---> 52\u001b[0m         historyList \u001b[38;5;241m=\u001b[39m \u001b[43mGiteeService\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgetHistoryIssueList\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcve_id\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m     53\u001b[0m         \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(historyList) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[0;32m     54\u001b[0m             info \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m 没有历史issue\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(cve_id)\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\service\\GiteeService.py:191\u001b[0m, in \u001b[0;36mgetHistoryIssueList\u001b[1;34m(cve)\u001b[0m\n\u001b[0;32m    190\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mgetHistoryIssueList\u001b[39m(cve): \u001b[38;5;66;03m# only return 不是代办的 issues，otherwise return []\u001b[39;00m\n\u001b[1;32m--> 191\u001b[0m     l \u001b[38;5;241m=\u001b[39m \u001b[43msearchIssuesByCVE\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcve\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    192\u001b[0m     ret \u001b[38;5;241m=\u001b[39m []\n\u001b[0;32m    193\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m item \u001b[38;5;129;01min\u001b[39;00m l:\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\service\\GiteeService.py:189\u001b[0m, in \u001b[0;36msearchIssuesByCVE\u001b[1;34m(cve)\u001b[0m\n\u001b[0;32m    188\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21msearchIssuesByCVE\u001b[39m(cve):\n\u001b[1;32m--> 189\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msearchIssueByKeyword\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcve\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\service\\GiteeService.py:187\u001b[0m, in \u001b[0;36msearchIssueByKeyword\u001b[1;34m(keyword)\u001b[0m\n\u001b[0;32m    184\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21msearchIssueByKeyword\u001b[39m(keyword):\n\u001b[0;32m    185\u001b[0m     url \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://gitee.com/openharmony/kernel_linux_5.10/issues?utf8=\u001b[39m\u001b[38;5;132;01m%E\u001b[39;00m\u001b[38;5;124m2\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m9C\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m93\u001b[39m\u001b[38;5;130;01m\\\u001b[39;00m\n\u001b[0;32m    186\u001b[0m \u001b[38;5;124m    &state=all&issue_search=\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(parse\u001b[38;5;241m.\u001b[39mquote(keyword))\n\u001b[1;32m--> 187\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mgetNoOpenStateIssueList\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\service\\GiteeService.py:137\u001b[0m, in \u001b[0;36mgetNoOpenStateIssueList\u001b[1;34m(url)\u001b[0m\n\u001b[0;32m    135\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mgetNoOpenStateIssueList\u001b[39m(url):\n\u001b[0;32m    136\u001b[0m     issue_list \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m--> 137\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m item \u001b[38;5;129;01min\u001b[39;00m \u001b[43mgetIssueBaseInfo\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[0;32m    138\u001b[0m         iss \u001b[38;5;241m=\u001b[39m Issue(item[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtitle\u001b[39m\u001b[38;5;124m'\u001b[39m], item[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124murl\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[0;32m    139\u001b[0m         \u001b[38;5;28;01mif\u001b[39;00m iss\u001b[38;5;241m.\u001b[39mstate \u001b[38;5;241m!=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m待办的\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\service\\GiteeService.py:118\u001b[0m, in \u001b[0;36mgetIssueBaseInfo\u001b[1;34m(url)\u001b[0m\n\u001b[0;32m    117\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mgetIssueBaseInfo\u001b[39m(url):\n\u001b[1;32m--> 118\u001b[0m     soup \u001b[38;5;241m=\u001b[39m \u001b[43mgetSoup\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43murl\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    119\u001b[0m     urls \u001b[38;5;241m=\u001b[39m soup\u001b[38;5;241m.\u001b[39mfind_all(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124ma\u001b[39m\u001b[38;5;124m\"\u001b[39m, class_\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtitle\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m    120\u001b[0m     urls \u001b[38;5;241m=\u001b[39m [{\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtitle\u001b[39m\u001b[38;5;124m'\u001b[39m: item[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtitle\u001b[39m\u001b[38;5;124m'\u001b[39m], \u001b[38;5;124m'\u001b[39m\u001b[38;5;124murl\u001b[39m\u001b[38;5;124m'\u001b[39m:\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://gitee.com/\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m+\u001b[39mitem[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhref\u001b[39m\u001b[38;5;124m\"\u001b[39m] } \u001b[38;5;28;01mfor\u001b[39;00m item \u001b[38;5;129;01min\u001b[39;00m urls]\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\common.py:22\u001b[0m, in \u001b[0;36mgetSoup\u001b[1;34m(url, __headers, __proxies)\u001b[0m\n\u001b[0;32m     21\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mgetSoup\u001b[39m(url, __headers \u001b[38;5;241m=\u001b[39m headers, __proxies \u001b[38;5;241m=\u001b[39m proxies):\n\u001b[1;32m---> 22\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m BeautifulSoup(\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m_headers\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m__headers\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m_proxies\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43m__proxies\u001b[49m\u001b[43m)\u001b[49m, features\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhtml.parser\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\common.py:18\u001b[0m, in \u001b[0;36mget\u001b[1;34m(url, _headers, _proxies, isText)\u001b[0m\n\u001b[0;32m     16\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget\u001b[39m(url, _headers \u001b[38;5;241m=\u001b[39m headers, _proxies \u001b[38;5;241m=\u001b[39m proxies, isText \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m):\n\u001b[0;32m     17\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m (isText):\n\u001b[1;32m---> 18\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mrequests\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43m_headers\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43m_proxies\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mverify\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mtext\n\u001b[0;32m     19\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m     20\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m requests\u001b[38;5;241m.\u001b[39mget(url, headers \u001b[38;5;241m=\u001b[39m _headers, proxies \u001b[38;5;241m=\u001b[39m _proxies, verify\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m)\n",
      "File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python38\\site-packages\\requests\\api.py:73\u001b[0m, in \u001b[0;36mget\u001b[1;34m(url, params, **kwargs)\u001b[0m\n\u001b[0;32m     62\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget\u001b[39m(url, params\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m     63\u001b[0m \u001b[38;5;250m    \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Sends a GET request.\u001b[39;00m\n\u001b[0;32m     64\u001b[0m \n\u001b[0;32m     65\u001b[0m \u001b[38;5;124;03m    :param url: URL for the new :class:`Request` object.\u001b[39;00m\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m     70\u001b[0m \u001b[38;5;124;03m    :rtype: requests.Response\u001b[39;00m\n\u001b[0;32m     71\u001b[0m \u001b[38;5;124;03m    \"\"\"\u001b[39;00m\n\u001b[1;32m---> 73\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mget\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python38\\site-packages\\requests\\api.py:59\u001b[0m, in \u001b[0;36mrequest\u001b[1;34m(method, url, **kwargs)\u001b[0m\n\u001b[0;32m     55\u001b[0m \u001b[38;5;66;03m# By using the 'with' statement we are sure the session is closed, thus we\u001b[39;00m\n\u001b[0;32m     56\u001b[0m \u001b[38;5;66;03m# avoid leaving sockets open which can trigger a ResourceWarning in some\u001b[39;00m\n\u001b[0;32m     57\u001b[0m \u001b[38;5;66;03m# cases, and look like a memory leak in others.\u001b[39;00m\n\u001b[0;32m     58\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m sessions\u001b[38;5;241m.\u001b[39mSession() \u001b[38;5;28;01mas\u001b[39;00m session:\n\u001b[1;32m---> 59\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python38\\site-packages\\requests\\sessions.py:589\u001b[0m, in \u001b[0;36mSession.request\u001b[1;34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[0m\n\u001b[0;32m    584\u001b[0m send_kwargs \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m    585\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtimeout\u001b[39m\u001b[38;5;124m\"\u001b[39m: timeout,\n\u001b[0;32m    586\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mallow_redirects\u001b[39m\u001b[38;5;124m\"\u001b[39m: allow_redirects,\n\u001b[0;32m    587\u001b[0m }\n\u001b[0;32m    588\u001b[0m send_kwargs\u001b[38;5;241m.\u001b[39mupdate(settings)\n\u001b[1;32m--> 589\u001b[0m resp \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprep\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43msend_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    591\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
      "File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python38\\site-packages\\requests\\sessions.py:703\u001b[0m, in \u001b[0;36mSession.send\u001b[1;34m(self, request, **kwargs)\u001b[0m\n\u001b[0;32m    700\u001b[0m start \u001b[38;5;241m=\u001b[39m preferred_clock()\n\u001b[0;32m    702\u001b[0m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[1;32m--> 703\u001b[0m r \u001b[38;5;241m=\u001b[39m \u001b[43madapter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    705\u001b[0m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n\u001b[0;32m    706\u001b[0m elapsed \u001b[38;5;241m=\u001b[39m preferred_clock() \u001b[38;5;241m-\u001b[39m start\n",
      "File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python38\\site-packages\\requests\\adapters.py:667\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[1;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[0;32m    664\u001b[0m     timeout \u001b[38;5;241m=\u001b[39m TimeoutSauce(connect\u001b[38;5;241m=\u001b[39mtimeout, read\u001b[38;5;241m=\u001b[39mtimeout)\n\u001b[0;32m    666\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 667\u001b[0m     resp \u001b[38;5;241m=\u001b[39m \u001b[43mconn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m    668\u001b[0m \u001b[43m        \u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    669\u001b[0m \u001b[43m        \u001b[49m\u001b[43murl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    670\u001b[0m \u001b[43m        \u001b[49m\u001b[43mbody\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    671\u001b[0m \u001b[43m        \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    672\u001b[0m \u001b[43m        \u001b[49m\u001b[43mredirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[0;32m    673\u001b[0m \u001b[43m        \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[0;32m    674\u001b[0m \u001b[43m        \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[0;32m    675\u001b[0m \u001b[43m        \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[0;32m    676\u001b[0m \u001b[43m        \u001b[49m\u001b[43mretries\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmax_retries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    677\u001b[0m \u001b[43m        \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    678\u001b[0m \u001b[43m        \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    679\u001b[0m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    681\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m    682\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m(err, request\u001b[38;5;241m=\u001b[39mrequest)\n",
      "File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python38\\site-packages\\urllib3\\connectionpool.py:789\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[1;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[0;32m    786\u001b[0m response_conn \u001b[38;5;241m=\u001b[39m conn \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m release_conn \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m    788\u001b[0m \u001b[38;5;66;03m# Make the request on the HTTPConnection object\u001b[39;00m\n\u001b[1;32m--> 789\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m    790\u001b[0m \u001b[43m    \u001b[49m\u001b[43mconn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    791\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    792\u001b[0m \u001b[43m    \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    793\u001b[0m \u001b[43m    \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout_obj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    794\u001b[0m \u001b[43m    \u001b[49m\u001b[43mbody\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    795\u001b[0m \u001b[43m    \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    796\u001b[0m \u001b[43m    \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    797\u001b[0m \u001b[43m    \u001b[49m\u001b[43mretries\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    798\u001b[0m \u001b[43m    \u001b[49m\u001b[43mresponse_conn\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mresponse_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    799\u001b[0m \u001b[43m    \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    800\u001b[0m \u001b[43m    \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    801\u001b[0m \u001b[43m    \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    802\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    804\u001b[0m \u001b[38;5;66;03m# Everything went great!\u001b[39;00m\n\u001b[0;32m    805\u001b[0m clean_exit \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
      "File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python38\\site-packages\\urllib3\\connectionpool.py:536\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[1;34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[0m\n\u001b[0;32m    534\u001b[0m \u001b[38;5;66;03m# Receive the response from the server\u001b[39;00m\n\u001b[0;32m    535\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 536\u001b[0m     response \u001b[38;5;241m=\u001b[39m \u001b[43mconn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgetresponse\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    537\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (BaseSSLError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m    538\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_raise_timeout(err\u001b[38;5;241m=\u001b[39me, url\u001b[38;5;241m=\u001b[39murl, timeout_value\u001b[38;5;241m=\u001b[39mread_timeout)\n",
      "File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python38\\site-packages\\urllib3\\connection.py:464\u001b[0m, in \u001b[0;36mHTTPConnection.getresponse\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m    461\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mresponse\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m HTTPResponse\n\u001b[0;32m    463\u001b[0m \u001b[38;5;66;03m# Get the response from http.client.HTTPConnection\u001b[39;00m\n\u001b[1;32m--> 464\u001b[0m httplib_response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgetresponse\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    466\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m    467\u001b[0m     assert_header_parsing(httplib_response\u001b[38;5;241m.\u001b[39mmsg)\n",
      "File \u001b[1;32mc:\\Program Files\\Python38\\lib\\http\\client.py:1322\u001b[0m, in \u001b[0;36mHTTPConnection.getresponse\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m   1320\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m   1321\u001b[0m     \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m-> 1322\u001b[0m         \u001b[43mresponse\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbegin\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   1323\u001b[0m     \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m:\n\u001b[0;32m   1324\u001b[0m         \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclose()\n",
      "File \u001b[1;32mc:\\Program Files\\Python38\\lib\\http\\client.py:303\u001b[0m, in \u001b[0;36mHTTPResponse.begin\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m    301\u001b[0m \u001b[38;5;66;03m# read until we get a non-100 response\u001b[39;00m\n\u001b[0;32m    302\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[1;32m--> 303\u001b[0m     version, status, reason \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_read_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    304\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m status \u001b[38;5;241m!=\u001b[39m CONTINUE:\n\u001b[0;32m    305\u001b[0m         \u001b[38;5;28;01mbreak\u001b[39;00m\n",
      "File \u001b[1;32mc:\\Program Files\\Python38\\lib\\http\\client.py:264\u001b[0m, in \u001b[0;36mHTTPResponse._read_status\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m    263\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_read_status\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m--> 264\u001b[0m     line \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreadline\u001b[49m\u001b[43m(\u001b[49m\u001b[43m_MAXLINE\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124miso-8859-1\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m    265\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(line) \u001b[38;5;241m>\u001b[39m _MAXLINE:\n\u001b[0;32m    266\u001b[0m         \u001b[38;5;28;01mraise\u001b[39;00m LineTooLong(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstatus line\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
      "File \u001b[1;32mc:\\Program Files\\Python38\\lib\\socket.py:669\u001b[0m, in \u001b[0;36mSocketIO.readinto\u001b[1;34m(self, b)\u001b[0m\n\u001b[0;32m    667\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m    668\u001b[0m     \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 669\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrecv_into\u001b[49m\u001b[43m(\u001b[49m\u001b[43mb\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    670\u001b[0m     \u001b[38;5;28;01mexcept\u001b[39;00m timeout:\n\u001b[0;32m    671\u001b[0m         \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_timeout_occurred \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
      "File \u001b[1;32mc:\\Program Files\\Python38\\lib\\ssl.py:1241\u001b[0m, in \u001b[0;36mSSLSocket.recv_into\u001b[1;34m(self, buffer, nbytes, flags)\u001b[0m\n\u001b[0;32m   1237\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m flags \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[0;32m   1238\u001b[0m         \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[0;32m   1239\u001b[0m           \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnon-zero flags not allowed in calls to recv_into() on \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m\n\u001b[0;32m   1240\u001b[0m           \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__class__\u001b[39m)\n\u001b[1;32m-> 1241\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnbytes\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   1242\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m   1243\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39mrecv_into(buffer, nbytes, flags)\n",
      "File \u001b[1;32mc:\\Program Files\\Python38\\lib\\ssl.py:1099\u001b[0m, in \u001b[0;36mSSLSocket.read\u001b[1;34m(self, len, buffer)\u001b[0m\n\u001b[0;32m   1097\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m   1098\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m buffer \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m-> 1099\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sslobj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   1100\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m   1101\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sslobj\u001b[38;5;241m.\u001b[39mread(\u001b[38;5;28mlen\u001b[39m)\n",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "# 2. 过往记录的排查\n",
    "# 从表格，Gitee，CI网站中获取信息\n",
    "# 是否实时获取，待定\n",
    "# 暂时均为获取实时的信息，但是每次花费的时间比较长\n",
    "import service.AnalysisService as AnalysisService\n",
    "# 2.1 获取表格中的信息\n",
    "## 需要从黄区中获取\n",
    "\n",
    "# 2.2 获取Gitee中的信息\n",
    "print(\"--------------Gitee中的信息---------------\")\n",
    "for cve_id in cve_id_list:\n",
    "    print(AnalysisService.analyzeGiteeWithoutCache(cve_id))\n",
    "# 2.3 获取CI网站中的信息\n",
    "print(\"--------------CI网站中的信息---------------\")\n",
    "for cve_id in cve_id_list:\n",
    "    print(AnalysisService.analyzeCIWithoutCache(cve_id))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 3.辅助信息获取，从hulk网站中获取config，分析情况，introduced by信息\n",
    "## 从黄区中获取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--------------6.6---------------\n",
      "CVE-2024-46726 3dc6bb57dab36b38b7374af0ac916174c146b6ed\n",
      "CVE-2024-46759 6891b11a0c6227ca7ed15786928a07b1c0e4d4af\n",
      "CVE-2024-46762 e997b357b13a7d95de31681fc54fcc34235fa527\n",
      "CVE-2024-46743 7ead730af11ee7da107f16fc77995613c58d292d\n",
      "CVE-2024-46758 46e4fd338d5bdbaf60e41cda625b24949d2af201\n",
      "CVE-2024-46763 1df42be305fe478ded1ee0c1d775f4ece713483b\n",
      "CVE-2024-46760 c83d464b82a8ad62ec9077637f75d73fe955635a\n",
      "CVE-2024-46719 3b9f2d9301ae67070fe77a0c06758722fd7172b7\n",
      "CVE-2024-46776 874e3bb302f97b94ac548959ec4f925b8e7b45e2\n",
      "CVE-2024-46744 c3af7e460a526007e4bed1ce3623274a1a6afe5e\n",
      "CVE-2024-46770 efe8effe138044a4747d1112ebb8c454d1663723\n",
      "CVE-2024-46771 4377b79323df62eb5d310354f19b4d130ff58d50\n",
      "CVE-2024-46746 60dc4ee0428d70bcbb41436b6729d29f1cbdfb89\n",
      "CVE-2024-46787 3c6b4bcf37845c9359aed926324bed66bdd2448d\n",
      "CVE-2024-46742 07f384c5be1f8633b13f0a22616e227570450bc6\n",
      "CVE-2024-46727 48e0b68e2360b16edf2a0bae05c0051c00fbb48a\n",
      "CVE-2024-46775 874e3bb302f97b94ac548959ec4f925b8e7b45e2\n",
      "CVE-2024-46725 a60d1f7ff62e453dde2d3b4907e178954d199844\n",
      "CVE-2024-46747 30e9ce7cd5591be639b53595c95812f1a2afdfdc\n",
      "CVE-2024-46750 78c6e39fef5c428960aff742149bba302dd46f5a\n",
      "CVE-2024-46722 d0a43bf367ed640e527e8ef3d53aac1e71f80114\n",
      "CVE-2024-46730 f1e261ced9bcad772a45a2fcdf413c3490e87299\n",
      "CVE-2024-46772 dfafee0a7b51c7c9612edd2d991401294964d02f\n",
      "CVE-2024-46777 a56330761950cb83de1dfb348479f20c56c95f90\n",
      "CVE-2024-46781 9d8c3a585d564d776ee60d4aabec59b404be7403\n",
      "CVE-2024-46740 1f33d9f1d9ac3f0129f8508925000900c2fe5bb0\n",
      "CVE-2024-46729 f1e261ced9bcad772a45a2fcdf413c3490e87299\n",
      "CVE-2024-46721 59f742e55a469ef36c5c1533b6095a103b61eda8\n",
      "CVE-2024-46782 18a5a16940464b301ea91bf5da3a324aedb347b2\n",
      "CVE-2024-46724 f9267972490f9fcffe146e79828e97acc0da588c\n",
      "CVE-2024-46773 dfafee0a7b51c7c9612edd2d991401294964d02f\n",
      "CVE-2024-46723 f2b7a9f3839e92f43559b2795b34640ca8cf839f\n",
      "CVE-2024-46780 8c6e43b3d5f109cf9c61bc188fcc8175404e924f\n",
      "CVE-2024-46778 8c6e43b3d5f109cf9c61bc188fcc8175404e924f\n",
      "CVE-2024-46791 8fecde9c3f9a4b97b68bb97c9f47e5b662586ba7\n",
      "CVE-2024-46745 a4858b00a1ec57043697fb935565fe267f161833\n",
      "CVE-2024-46732 d2fe7ac613a1ea8c346c9f5c89dc6ecc27232997\n",
      "CVE-2024-46733 7b5595f33c3c273613b590892a578d78186bb400\n",
      "CVE-2024-46783 c8219a27fa43a2cbf99f5176f6dddfe73e7a24ae\n",
      "CVE-2024-46756 8fecb75bff1b7d87a071c32a37aa0700f2be379d\n",
      "CVE-2024-46728 48e0b68e2360b16edf2a0bae05c0051c00fbb48a\n",
      "CVE-2024-46737 489f2913a63f528cfe3f21722583fb981967ecda\n",
      "CVE-2024-46761 b82d4d5c736f4fd2ed224c35f554f50d1953d21e\n",
      "CVE-2024-46757 2f695544084a559f181cafdfd3f864c5ff9dd1db\n",
      "CVE-2024-46755 c2618dcb26c7211342b54520b5b148c0d3471c8a\n",
      "CVE-2024-46739 de6946be9c8bc7d2279123433495af7c21011b99\n",
      "CVE-2024-46714 e3a95f29647ae45d1ec9541cd7df64f40bf2120a\n",
      "CVE-2024-46731 f1e261ced9bcad772a45a2fcdf413c3490e87299\n",
      "CVE-2024-46738 39e7e593418ccdbd151f2925fa6be1a616d16c96\n",
      "CVE-2024-46765 2f057db2fb29bc209c103050647562e60554d3d3\n",
      "CVE-2024-46707 9d7629bec5c3f80bd0e3bf8103c06a2f7046bd92\n",
      "CVE-2024-46702 18b3ad2a3cc877dd4b16f48d84aa27b78d53bf1d\n",
      "CVE-2024-46695 459584258d47ec3cc6245a82e8a49c9d08eb8b57\n",
      "CVE-2024-46811 4003bac784380fed1f94f197350567eaa73a409d\n"
     ]
    }
   ],
   "source": [
    "# 4. 合入阶段，找出commit_id\n",
    "import service.CommitService as CommitService\n",
    "# print(\"--------------5.10---------------\")\n",
    "# for cve_id in cve_id_list:\n",
    "#     dic_all_conclusion = CommitService.getCommitIdFromCVE(cve_id)\n",
    "#     if dic_all_conclusion:\n",
    "#         print(cve_id, dic_all_conclusion['stable/5.10'])\n",
    "#     else :\n",
    "#         print(cve_id, \"None\")\n",
    "print(\"--------------6.6---------------\")\n",
    "for cve_id in cve_id_list:\n",
    "    dic_all_conclusion = CommitService.getCommitIdFromCVE(cve_id)\n",
    "    if dic_all_conclusion:\n",
    "        print(cve_id, dic_all_conclusion['stable/6.6'])\n",
    "    else :\n",
    "        print(cve_id, \"None\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "cve_id is empty",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[3], line 6\u001b[0m\n\u001b[0;32m      4\u001b[0m cve_id \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m      5\u001b[0m refuse_reason \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m----> 6\u001b[0m \u001b[43mCIService\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrefuse_cve\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcve_id\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrefuse_reason\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mc:\\Users\\wangxin\\Documents\\cve-analyze\\service\\CIService.py:142\u001b[0m, in \u001b[0;36mrefuse_cve\u001b[1;34m(cve_id, cve_refuse_reason)\u001b[0m\n\u001b[0;32m    140\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mrefuse_cve\u001b[39m(cve_id, cve_refuse_reason):\n\u001b[0;32m    141\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m cve_id \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m cve_id \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m--> 142\u001b[0m         \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcve_id is empty\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m    143\u001b[0m     analyzeInfo \u001b[38;5;241m=\u001b[39m get_analyzeInfo(cve_id)[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124manalyze\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[0;32m    144\u001b[0m     \u001b[38;5;66;03m# pprint.pprint(analyzeInfo)\u001b[39;00m\n",
      "\u001b[1;31mValueError\u001b[0m: cve_id is empty"
     ]
    }
   ],
   "source": [
    "# 5. 关闭阶段\n",
    "## 对于状态为【不涉及】的cve，进行拒绝，拒绝类型为【误报】，原因需从表格获取\n",
    "import service.CIService as CIService\n",
    "cve_id = \"\"\n",
    "refuse_reason = \"\"\n",
    "CIService.refuse_cve(cve_id, refuse_reason)\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
